<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta charset="UTF-8">
    <!--1.添加视口标签 快捷方式：meta:vp -->
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"/>
    <!--2.设置网页渲染模式  快捷方式：meta:compat  -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <!--3.把bootstrap 核心样式（压缩版）引入-->
    <link rel="stylesheet" href="/static/css/bootstrap.min.css"/>
    <title>发布界面</title>
    <style type="text/css">
        {#        label {#}
        {#            display: block;#}
        {#            margin: 50px auto;#}
        {#        }#}

        {##}
        .da {
        {#                    text-align: center;#} position: relative;
            right: -30%;
        }
        body{
            background-color: #1ba354;
        }
    </style>
</head>
<body>
<h1 class="text-center"><b>发布界面</b></h1>
<div class="da text-center center-block ">

    <div style="height: 50px"></div>
    <form class="form-horizontal center-block" method="post" action="">


        <div class="form-group host">
            <label for="inputEmail3" class="col-sm-2 control-label">要发布的主机：</label>
            <div class="col-sm-2">
                {#                <input type="email" class="form-control" id="inputEmail3" placeholder="Email">#}
                <select class="btn btn-primary form-control" name="host">
                    <option selected="selected">未选择请选择</option>
                    {% for i in data2 %}
                        <option class="host_id">{{ i.hostname }}</option>
                    {% endfor %}
                </select>
            </div>
        </div>


        <div class="form-group group">
            {#    <label class="group">要发布的主机组：</label>#}
            <label for="inputEmail3" class="col-sm-2 control-label">要发布的主机组：</label>
            <div class="col-sm-2">
                <select class="btn btn-primary form-control" name="host_group">
                    <option selected="selected">未选择请选择</option>
                    {% for i in data3 %}
                        <option>{{ i }}</option>
                    {% endfor %}
                </select>
            </div>
        </div>

        <div class="form-group">
            <label for="inputEmail3" class="col-sm-2 control-label">要发布的文件：</label>
            <div class="col-sm-2">
                <select class="btn btn-primary  form-control" name="file">
                    <option selected="selected">未选择请选择</option>
                    {% for i in data %}
                        <option>{{ i.headImg }}</option>
                    {% endfor %}
                </select>
            </div>
        </div>

        <div class="form-group">
            <label for="inputEmail3" class="col-sm-2 control-label">服务类型:</label>
            <div class="col-sm-2">
                <select class="btn btn-primary form-control" name="service">
                    <option selected="selected">未选择请选择</option>
                    {% for i in data1 %}
                        <option>{{ i.service_name }}</option>
                    {% endfor %}
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">要发布的路径：</label>
            <div class="col-sm-2">
                <input class="form-control" type="text" name="dir">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">发布成功后要执行的命令：</label>
            <div class="col-sm-2">

                <textarea class="form-control" name="cmd"></textarea>
            </div>
        </div>
    <div class="form-group">
            <label class="col-sm-2 control-label"></label>
            <div class="col-sm-1">
<input type="submit" value="提交" class="btn btn-primary form-control">

            </div>
        </div>


    </form>
    {% if post_ok %}
        <h1 style="color: red">{{ post_ok }}</h1>
    {% endif %}
</div>
<!--4.把jQuery 引入-->
<script src="/static/js/jquery-1.10.2.min.js"></script>
<!--5.把bootstrap 核心脚本文件（压缩版）引入-->
<script src="/static/js/bootstrap.min.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $(".group").click(function () {
            $(".host").hide();
        });
        $(".host").click(function () {
            $(".group").hide();
        });
    })
</script>
</body>
</html>